﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace ViewLibrary.Controls
{
	public class LinkLabel : Label
	{
		public LinkLabel()
		{
			this.Cursor = Cursors.Hand;
			this.Foreground = Brushes.Blue;
		}

		protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
		{
			base.OnMouseLeftButtonDown(e);
			if (Target != null)
			{
				Target.Focus();
			}
		}

		protected override void OnMouseEnter(MouseEventArgs e)
		{
			base.OnMouseEnter(e);
			this.FontStyle = FontStyles.Italic;
		}

		protected override void OnMouseLeave(MouseEventArgs e)
		{
			base.OnMouseLeave(e);
			this.FontStyle = FontStyles.Normal;
		}
	}
}